package com.docker.nitsample.di;

import android.support.v4.app.Fragment;

import com.alibaba.android.arouter.launcher.ARouter;
import com.bfhd.account.ui.index.FragmentMineIndex;
import com.docker.common.common.config.Constant;
import com.docker.common.common.model.CommonListOptions;
import com.docker.common.common.router.AppRouter;
import com.docker.common.common.ui.container.NitCommonCardFragment;
import com.docker.common.common.ui.container.NitCommonCardNoRefreshFragment;
import com.docker.common.common.ui.container.NitCommonContainerFragment;
import com.docker.common.common.ui.container.NitCommonContainerFragmentV2;
import com.docker.common.common.utils.cache.CacheUtils;
import com.docker.nitsample.ui.index.IndexTygsFragment;
import com.docker.nitsample.ui.optimization.OptimizationFragment;
import com.docker.videobasic.ui.VideoListFragment;

import java.util.ArrayList;
import java.util.List;

import dagger.Module;
import dagger.Provides;

@Module
public class MainTygsModule {

    @Provides
    List<Fragment> providerFragments() {

        List<Fragment> fragments = new ArrayList<>();

        //公社首页
        CommonListOptions commonListOptions = new CommonListOptions();
        commonListOptions.falg = 0;
        commonListOptions.refreshState = 0;
        commonListOptions.RvUi = 0;
        fragments.add(IndexTygsFragment.newinstance(commonListOptions));

        if (!CacheUtils.getIsShwo()) {
            fragments.add((Fragment) ARouter.getInstance().build(AppRouter.ACTIVE_FRAME_LIST).navigation());
            fragments.add((Fragment) ARouter.getInstance().build(AppRouter.MESSAGELIST).withInt("style", 1).navigation());
        } else {
            //公社优选
            CommonListOptions commonListOptions1 = new CommonListOptions();
            commonListOptions1.falg = 1;
            commonListOptions1.refreshState = Constant.KEY_REFRESH_OWNER;
            commonListOptions1.RvUi = Constant.KEY_RVUI_LINER;
            commonListOptions1.ReqParam.put("", "");
            fragments.add(OptimizationFragment.newinstance(commonListOptions));
            fragments.add((Fragment) ARouter.getInstance().build(AppRouter.MESSAGELIST_IM).navigation());
        }

        //个人中心
        CommonListOptions commonListOptions3 = new CommonListOptions();
        commonListOptions3.falg = 3;
        commonListOptions3.isActParent = true;
        commonListOptions3.RvUi = Constant.KEY_RVUI_LINER;
        commonListOptions3.refreshState = Constant.KEY_REFRESH_PURSE;
        commonListOptions3.externs.put("NeedVisibleRefresh", "yes");
        NitCommonCardNoRefreshFragment nitCommonCardFragment = NitCommonCardNoRefreshFragment.newinstance(commonListOptions3);
        fragments.add(nitCommonCardFragment);

        return fragments;
    }


}

